<?php
require_once 'Zend/Db.php';
require_once 'Zend/Config/Ini.php';
//require_once 'FtpHelper.php';
/**
 * 初始化web的内容
 * @author Administrator
 *
 */
class mininit{
	private $minicmdpath="/data/web/library/Common/Command/";//命令路径
	private $minicmdwebpath="";
	function web(){
		//system("nohup php ".$this->minicmdpath."minicmd.php &\n");//启动minicmd脚本
		system("wget http://127.0.0.1/notify/touch/signal/41 -O /dev/null");//设置lvs
		system("wget http://127.0.0.1/notify/touch/signal/40 -O /dev/null");//设置ftp密码
		system("wget http://127.0.0.1/notify/touch/signal/39 -O /dev/null");//重载点播配置文件
		system("wget http://127.0.0.1/notify/touch/signal/35 -O /dev/null");//通知主控端
		system("wget http://127.0.0.1/notify/touch/signal/37 -O /dev/null");//通知受控端
		system("wget http://127.0.0.1/notify/touch/signal/38 -O /dev/null");//重载直播配置文件
		
		system("nohup sh ".$this->minicmdpath."phpcommand.daily");//获取节目单
		//生成静态文件 	
		//重建索引
    }
    /*
     * mysql启动准备
     * */
    function mysql(){
    	system('\cp -r '.$this->minicmdpath.'config/* /');//拷贝配置文件
    	/*if(file_exists($this->minicmdpath."my.cnf")){
    		copy($this->minicmdpath."my.cnf", "/etc/my.cnf");
    	}*/
    }
}
$cmd=$argv[1]; 
if($cmd=="web"){
	$command = new mininit();
	$command->web();
	syslog(LOG_INFO, ": mininit - web.");
}
if($cmd=="mysql"){
	$command = new mininit();
	$command->mysql();
	syslog(LOG_INFO, ": mininit - mysql.");
}
